package jisuanji;

import java.awt.geom.Rectangle2D;
import java.awt.Shape;

public class Rectangle extends MyShape {
    private double len, wid;
    
    public Rectangle(double l, double w) {
        super("长方形");
        len = l;
        wid = w;
    }
    
    @Override
    public double getArea() {
        return len * wid;
    }
    
    @Override
    public double getPerimeter() {
        return 2 * (len + wid);
    }
    
    @Override
    public Shape getRealShape() {
        return new Rectangle2D.Double(0, 0, len, wid);
    }
}